﻿<%IF not(Session("logKEY")="_root"  or Session("logKEY")="_administrator" ) THEN
response.redirect "noAcRight.asp"
response.end
END IF
%>
<!--#include file=../../include/config.asp -->
<!--#include file=../../include/conn3.asp -->
<%
'无高级管理员权限者无法访问此页【未写】

%>


<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=Sitename%></title>
<link href="../../style/base.css" rel="stylesheet" type="text/css" />
<link href="../../style/admin.css" rel="stylesheet" type="text/css" />
<script language="javascript">
function CheckForm()
{
  if (document.adduser.username.value == "")
  {
    alert("用户名不能为空！");
	document.adduser.username.focus();
	return false;
  }
 
  if (document.adduser.passwordset.value =="")
  {
    alert("密码不能为空！");
	document.adduser.passwordset.focus();
	return false;
  }

  if((document.adduser.passwordset.value!=document.adduser.passwordset2.value))
    {
      alert("对不起，您输入的密码不一致，请重新输入！");
	  document.adduser.passwordset2.focus();
      return false;
    }

  if(document.adduser.passwordset.value.length<6)
  {
	  alert("输入的密码不能少于6位!");
	  document.adduser.passwordset.focus();
	  return false;
	}
	
  return true;  
};
</script>
</head>
<body>
	<div>增加管理员</div>
	<form name="adduser" onSubmit="return CheckForm();" method="POST" action="useradd.asp">
	<div><label>用户名</label><input name="username" type="text" size="15" maxlength="10" /></div>
	<div><label>用户权限</label>
	<select name="select">
	<%
	Set rs = Server.CreateObject("ADODB.Recordset") 
	rs.Source="select * from usertype WHERE isAdmin=True AND isAval=True "
	rs.open rs.Source,conn,1,1
	if rs.eof and rs.bof then%>
		<option value="1" selected>系统管理员</option>
	<%
	else
	%>
		<option value="<%=rs("typeID")%>" selected><%=rs("typename2")%></option>
	<%
	rs.movenext
	while not rs.eof
	%>
		<option value="<%=rs("typeID")%>"><%=rs("typename2")%></option>
	<%
	rs.movenext
	wend
	end if
	%>
	</select></div>
	<div><label>密码</label><input name="passwordset" type="password" size="15" maxlength="16" /></div>
	<div><label>密码确认</label><input name="passwordset2" type="password" size="15" maxlength="16" /></div>
	<div>
		<input type="submit" value="增加" name="submit" />
		<input type="reset" value="清除" name="reset" />
	</div>
	</form>
</body>
</html>
<% call CloseConn() %>